﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MsSql.cs" company="DHGMS Solutions">
//   Copyright 2004-2014 DHGMS Solutions.
//      
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//      
//   http://www.apache.org/licenses/LICENSE-2.0
//      
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
// <summary>
//   Handles job reporting to MS SQL
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Dhgms.TplHelper.Model.Provider.Job
{
    using System;
    using System.Collections.Specialized;

    using Dhgms.TplHelper.Model.Info.JobResult;

    /// <summary>
    /// Handles job reporting to MS SQL
    /// </summary>
    /// <typeparam name="TJobResultClass">
    /// </typeparam>
    public class MsSql<TJobResultClass> : JobMonitoringBase<TJobResultClass>
        where TJobResultClass : Base, new()
    {
        #region Public Methods and Operators

        /// <summary>
        /// Handles sending of error information to different mediums
        /// </summary>
        /// <param name="programGuid">
        /// Unique GUID used to identify program
        /// </param>
        /// <param name="programName">
        /// Friendly name of program
        /// </param>
        /// <param name="e">
        /// Exception message
        /// </param>
        public override void OnJobFailure(Guid programGuid, string programName, Exception e)
        {
        }

        /// <summary>
        /// Notify the provider of a job start
        /// </summary>
        /// <param name="jobGuid">
        /// Unique ID of the job
        /// </param>
        public override void OnJobStart(Guid jobGuid)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles sending out the result information
        /// </summary>
        /// <param name="jobGuid">
        /// Unique GUID used to identify program
        /// </param>
        /// <param name="jobName">
        /// Friendly name of program
        /// </param>
        /// <param name="taskResult">
        /// Run results of task
        /// </param>
        public override void OnJobSucess(Guid jobGuid, string jobName, TJobResultClass taskResult)
        {
        }

        /// <summary>
        /// Handles the sending of a task failure notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        /// <param name="e">
        /// Exception message
        /// </param>
        public override void OnTaskFailure(Guid taskGuid, Exception e)
        {
        }

        /// <summary>
        /// Handles the sending of a task start notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        public override void OnTaskStart(Guid taskGuid)
        {
        }

        /// <summary>
        /// Handles the sending of a task completion notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        public override void OnTaskSucess(Guid taskGuid)
        {
        }

        #endregion

        #region Methods

        /// <summary>
        /// On Initlize event
        /// </summary>
        /// <param name="name">
        /// </param>
        /// <param name="config">
        /// </param>
        protected override void OnInitialize(string name, NameValueCollection config)
        {
        }

        #endregion
    }
}